package com.srpingde.hhh;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.RelativeLayout.LayoutParams;
import android.widget.TextView;

import com.springde.hhh.R;
import com.srpingde.hhh.application.HhhApp;
import com.srpingde.hhh.http.AsyncHttpResponseHandler;
import com.srpingde.hhh.http.RequestParams;
import com.srpingde.hhh.jiekou.HHHIml;
import com.srpingde.hhh.jiekou.HHHInterface;

public class ShouCangJiaActivity extends Activity {
	ImageView back;
	HHHIml weiQuIml;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_shou_cang_jia);
        layout();
       // getData();
    }
    public void onClick(View v){
    	Intent in = null;
    	switch (v.getId()) {
		case R.id.back:
			finish();
			break;
		case R.id.shangpin:
			in = new Intent(this,MyCollectionsActivity.class);
			in.putExtra("type", "1");
			startActivity(in);
			break;
		case R.id.jueshimeitu:
			in = new Intent(this,MyCollectionsActivity.class);
			in.putExtra("type", "2");
			startActivity(in);
			break;
		case R.id.jingdianhaowen:
			in = new Intent(this,MyCollectionsActivity.class);
			in.putExtra("type", "3");
			startActivity(in);
			break;
		}
    	
    }
    private void layout() {
    	weiQuIml = new HHHIml();
		// 头的高度
		TextView top_title_tv = (TextView) findViewById(R.id.top_title);
		RelativeLayout.LayoutParams titleLayoutParams = (android.widget.RelativeLayout.LayoutParams) top_title_tv
				.getLayoutParams();
		titleLayoutParams.height = HhhApp.getInstance().title_h();
		top_title_tv.setLayoutParams(titleLayoutParams);
		//back
		back = (ImageView) findViewById(R.id.back);
		RelativeLayout.LayoutParams backLayoutParams = (LayoutParams) back.getLayoutParams();
		backLayoutParams.height = HhhApp.getInstance().title_h();
		back.setLayoutParams(backLayoutParams);
		
		itemLayout((Button) findViewById(R.id.shangpin));
		itemLayout((Button) findViewById(R.id.jueshimeitu));
		itemLayout((Button) findViewById(R.id.jingdianhaowen));
	}
    private void itemLayout(Button  textView){
		Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.setting);
		LinearLayout.LayoutParams layoutParams = (android.widget.LinearLayout.LayoutParams) textView.getLayoutParams();
		layoutParams.height = bitmap.getHeight();
		textView.setLayoutParams(layoutParams);
	}
}
